home *** CD-ROM | disk | FTP | other *** search
- 1000 ; togglegadget date: 10-03-88
- 1010 ;---------------------------------
- 1020 ;
- 1030 ; the final cartridge iii desktop
- 1040 ;
- 1050 ; riska h&p, marc derksen
- 1060 ;
- 1070 ; p r o j e c t d e m o
- 1080 ;
- 1090 ;---------------------------------
- 1100 ;
- 1110 *=$0be1,$0801
- 1120 curggflags=$c013
- 1130 ;
- 1140 buf0=$a3
- 1150 buf1=$a4
- 1160 gosub=$de05 ; system constants
- 1170 close=$01
- 1180 toback=$02
- 1190 dragbr=$08
- 1200 invert=$01
- 1210 status=$02
- 1220 bordr=$04
- 1230 release=$10
- 1240 toggle=$20
- 1250 ;
- 1260 ;------ basic startup data -----
- 1270 wor $0817,1987 ; line number
- 1280 byt $9e ; basic sys-code
- 1290 byt "2076 desk[164]p v1.0",0,0,0
- 1300 byt 1,0 ; version
- 1310 byt 2 ; size in blocks
- 1320 jmp $dfe8 ; startup
- 1330 byt 0 ; unused
- 1340 ;
- 1350 mn3it1=$c0c2
- 1360 mn3it2=$c0ca
- 1370 ;------ main ------------------
- 1380 start jsr survive
- 1390 ldx #<item2 ; set new menu
- 1400 ldy #>item2
- 1410 stx mn3it1
- 1420 sty mn3it1+1
- 1430 rts
- 1440 ;
- 1450 ;------ menuitem structure ---
- 1460 item2 wor item3 ; nextitem
- 1470 wor it2txt ; item name
- 1480 wor openwd ; item exec
- 1490 byt 1,0 ; enable item
- 1500 item3 wor 0 ; no nextitem
- 1510 wor it3txt
- 1520 wor unlink
- 1530 byt 1,0
- 1540 ;
- 1550 it2txt byt "[196][197][205][207][160][215][196]",0
- 1560 it3txt byt "[213][206][204][201][206][203]",0
- 1570 ;
- 1580 ggflags=invert+bordr+release+toggle
- 1590 ;------ window ---------------
- 1600 openwd ldx #<window ; call openwd
- 1610 ldy #>window
- 1620 lda #openwindow
- 1630 jmp gosub
- 1640 ;
- 1650 window wor gadget ; first gadget
- 1660 byt 40,40 ; wdx,wdy
- 1670 byt 110,50 ; width,height
- 1680 wor wdtitle ; window name
- 1690 byt close+toback+dragbr ; wdflags
- 1700 byt 66 ; wdtitle size
- 1710 wor 0,0
- 1720 ;
- 1730 gadget wor 0 ; next gadget
- 1740 byt 19,25 ; ggx,ggy
- 1750 byt 70,12 ; width,height
- 1760 wor ggtext ; gadget text
- 1770 byt ggflags ; gadget flags
- 1780 wor 0,ggexec,0 ; gadget exec
- 1790 ;
- 1800 wdtitle byt "[205]y [215]indow",0
- 1810 ggtext byt 5,2,1 ; text structure
- 1820 byt "[212]oggle [199]adget",0
- 1830 ;
- 1840 ;------ gadget exec ----------
- 1850 ggexec lda curggflags
- 1860 and #status ; test gadget status
- 1870 beq noselect
- 1880 inc $d020 ; gadget selected
- 1890 rts
- 1900 noselect dec $d020 ; unselected
- 1910 rts
- 1920 ;
- 1930 ;------ unlink ---------------
- 1940 unlink ldx #<window ; close wd
- 1950 ldy #>window
- 1960 jsr closewd
- 1970 ldx #<mn3it2 ; remove menu
- 1980 ldy #>mn3it2
- 1990 stx mn3it1
- 2000 sty mn3it1+1
- 2010 inc $8004 ; remove survive
- 2020 rts
- 2030 ;
- 2040 ;------ close window ---------
- 2050 closewd stx buf0
- 2060 sty buf1
- 2070 lda #wdonscreen ; if wd open
- 2080 jsr gosub
- 2090 iny
- 2100 beq not
- 2110 ldx buf0 ; then closewd
- 2120 ldy buf1
- 2130 lda #setcurwd
- 2140 jsr gosub
- 2150 lda #wdclose
- 2160 jsr gosub
- 2170 not rts
- 2180 ;
- 2190 ;------ reset survive --------
- 2200 survive ldx #6-1 ; install code
- 2210 slp lda tabel,x
- 2220 sta $8000,x
- 2230 dex
- 2240 bpl slp
- 2250 rts
- 2260 tabel wor start+3
- 2270 byt "mg87"
- 2280 ;
- 2290 ;------ includes -------------
- 2300 openwindow=48
- 2310 wdonscreen=70
- 2320 wdclose=65
- 2330 setcurwd=29
-